<template>
  <div>
    <div class="box" @click="Network(0)">{{ mydata[0] }}</div>
    <div class="box" @click="Network(1)">{{ mydata[1] }}</div>
    <div class="box" @click="Network(2)">{{ mydata[2] }}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      allindex1: [],
      mydata: "",
    };
  },
  methods: {
    Network(index){
       this.$router.push({ path: `/caidan?id=${this.allindex1[index]}` });
    },
    content(res) {
      let arr = [];
      let arr1=[];
      res.data.forEach((el) => {
        if (el.content == "类") {
        } else {
          arr.push(el.content);
          arr1.push(el.id)
        }
      });
      this.mydata = arr;
      this.allindex1=arr1;
    },
  },
  mounted() {
    this.$axios({
      url: "http://localhost:8081/zhh/caipufenleidata",
      params: {
        titleData: this.mydata1,
      },
    }).then((res) => {
      this.content(res);
    });
  },
  props: {
    mydata1: {
      type: String | undefined,

      required: true,
    },
  },
};
</script>

<style  scoped>
.box {
  font-size: 15px;
  margin-top: 40px;
  cursor: pointer;
}
.box:hover {
  color: #dd3915;
}
</style>